import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;


public class test {
	/*public static void main(String a[])
	{
		String str = "E:\\\\b\\";
		File file=new File(str);
		String test[];  
		test=file.list();
		Connection conn=null;
		Statement stmt=null; 
		ResultSet rs=null;
		try{
			Class.forName("oracle.jdbc.driver.OracleDriver"); 
			conn = DriverManager.getConnection("jdbc:oracle:thin:@121.52.215.132:1521:orcl","cms","bJ98eiEouZVn"); 
			String sql="select * from t_message"; 
			stmt = conn.createStatement(); 
			rs = stmt.executeQuery(sql);
			List<Map<String,String>> list = new ArrayList<Map<String,String>>();
			Map<String,String> map=null;
			while(rs.next())
			{
				map = new HashMap<String,String>();
				map.put("name", rs.getString("filename"));
				map.put("rname", rs.getString("rfilename"));
				list.add(map);
			}
			System.out.println(list.size());
			for(int i=0;i<test.length;i++)
			{  
				String rr = "";
				int flag = 0;
				for(int j=0;j<list.size();j++)
				{
					map = list.get(j);
					if(map.get("name")!=null && !"".equals(map.get("name"))&&!"null".equals(map.get("name")))
					{
						if(map.get("name").equals(test[i]))
						{
							rr = map.get("rname");
							if(rr!=null && !"".equals(rr)&&!"null".equals(rr))
							{
								int fileLen = 0;
								try
								{
									FileOutputStream fos = new FileOutputStream(str+"a\\"+rr);
							        FileInputStream fis = new FileInputStream(new File(str+test[i]));
							        byte[] buffer = new byte[1024];
							        int len = 0;
							        while((len = fis.read(buffer))>0)
							        {
							        	fileLen += len;
							            fos.write(buffer, 0, len);
							        }
							        fos.close();
							        fis.close();
								}
								catch (Exception ex)
								{
									ex.printStackTrace();
								}   
								
								System.out.println("name:"+test[i]+"   rname:"+rr +" 文件复制成功");  
							}
							flag = 1;
						}
					}
				}
				if(flag==1)
				{
				}
				else
				{
					System.out.println("name:"+test[i]+"  rname:"+rr +"  没找到该记录");
				}

				
			}
		}catch(Exception ex)
		{
			System.out.println("error:"+ex.getMessage());
		}finally
		{
			if(rs!=null)
				try {
					rs.close();
				} catch (SQLException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			if(stmt!=null)
				try {
					stmt.close();
				} catch (SQLException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			if(conn!=null)
				try {
					conn.close();
				} catch (SQLException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
		}
		
	}*/
	
public static void main(String[] args) {
	Set<Integer> s = new HashSet<Integer>();
	s.add(1);
	s.add(2);
	s.add(3);
	s.add(4);
	s.add(5);
	Iterator<Integer> it = s.iterator();
	while(it.hasNext()){
		System.out.println(it.next());
	}
	
}
}
